﻿<UserControl x:Class="Dotway.WPF.Samples.DotwaySampleApplication.EditSliderSample"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:controls="clr-namespace:Dotway.WPF.Controls;assembly=Dotway.WPF.Controls"
    >
    <Grid Margin="20">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <controls:EditSlider x:Name="editSlider1" Grid.Column="0" Width="200" Minimum="10" Maximum="100" Value="50"/>
        <StackPanel Grid.Column="0" VerticalAlignment="Bottom" Margin="10">
            <TextBlock Text="This is a editable slider. Single click the slider and the value can be edited in a TextBox." TextWrapping="Wrap"/>
            <TextBlock Text="Minimum:" />
            <Slider x:Name="minSlider1" Minimum="-100" Maximum="{Binding ElementName=maxSlider1, Path=Value}" Value="{Binding ElementName=editSlider1, Path=Minimum, Mode=TwoWay}" />
            <TextBlock Text="Maximum:" />
            <Slider x:Name="maxSlider1" Minimum="{Binding ElementName=minSlider1, Path=Value}" Maximum="100" Value="{Binding ElementName=editSlider1, Path=Maximum, Mode=TwoWay}" />            
            <TextBlock Text="Value:" />
            <TextBlock Text="{Binding ElementName=editSlider1, Path=Value}" />
            <TextBlock Text="Orientation: Horizontal" />
        </StackPanel>
        
        <controls:EditSlider x:Name="editSlider2" Grid.Column="1" Height="200" Minimum="10" Maximum="100" Value="50" Orientation="Vertical" />
        <StackPanel Grid.Column="1" VerticalAlignment="Bottom" Margin="10">
            <TextBlock Text="This is a editable slider. Single click the slider and the value can be edited in a TextBox." TextWrapping="Wrap"/>
            <TextBlock Text="Minimum:" />
            <Slider x:Name="minSlider2" Minimum="-100" Maximum="{Binding ElementName=maxSlider2, Path=Value}" Value="{Binding ElementName=editSlider2, Path=Minimum, Mode=TwoWay}" />
            <TextBlock Text="Maximum:" />
            <Slider x:Name="maxSlider2" Minimum="{Binding ElementName=minSlider2, Path=Value}" Maximum="100" Value="{Binding ElementName=editSlider2, Path=Maximum, Mode=TwoWay}" />
            <TextBlock Text="Value:" />
            <TextBlock Text="{Binding ElementName=editSlider2, Path=Value}" />
            <TextBlock Text="Orientation: Vertical" />
        </StackPanel>
    </Grid>
</UserControl>
